package com.glsc.ngateway.common.base.domain.mysql.gateway.platform.it;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Entity
@Data
@Table(name = "t_it_virtual_device")
public class ItVirtualDevice implements Serializable {

    @Id
    @Column(name = "dev_id")
    private String devId;

    @Column(name = "business_name")
    private String businessName;

    @Column(name = "application_detail")
    private String applicationDetail;

    @Column(name = "machine_area")
    private String machineArea;

    @Column(name = "virtual_name")
    private String virtualName;

    @Transient
    private String machineRoom;

    @Column(name = "operation_sys")
    private String operationSys;

    @Column(name = "vcent_ip")
    private String vcentIp;

    @Column(name = "virtual_ip")
    private Integer virtualIp;

    @Column(name = "qj")
    private String qj;

    @Column(name = "cpu")
    private String cpu;

    @Column(name = "memory")
    private String memory;

    @Column(name = "user_id")
    private String userId;

    @Column(name = "bz")
    private String bz;

    @Column(name = "ip1")
    private String ip1;
    @Column(name = "ip2")
    private String ip2;
    @Column(name = "mac1")
    private String mac1;
    @Column(name = "mac2")
    private String mac2;
    @Column(name = "ip3")
    private String ip3;
    @Column(name = "ip4")
    private String ip4;

    @Column(name = "bf")
    private String bf;
    @Column(name = "network_segment")
    private String networkSegment;
    @Column(name = "mark")
    private String mark;

    @Column(name = "insert_time", columnDefinition = "datetime comment '创建时间'")
    @org.hibernate.annotations.CreationTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime insertTime;

    @Column(name = "update_time", columnDefinition = "datetime comment '更新时间'")
    @org.hibernate.annotations.UpdateTimestamp
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    protected LocalDateTime updateTime;

    @Transient
    private String userAccount;


    @Transient
    private String userName;


    @Transient
    private String machineAreaName;


    @Transient
    private String opName;
    @Transient
    private String mxName;

    @Transient
    private String department;


    @Transient
    private String opStyle;


    @Transient
    private String opStyleName;

    @Transient
    private List<String> ipList;
}
